package com.kmxd.ams.infra.utils;

import cn.easyes.annotation.rely.FieldType;

/**
 * 数据库类型转换为es类型
 *
 * @author nickbi
 */
public class EsFieldUtil {
  private EsFieldUtil() {}

  public static FieldType convertType(String dbType) {
    String type = dbType.toLowerCase();
    switch (type) {
      case "datetime":
        return FieldType.DATE;
      case "text":
        return FieldType.TEXT;
      default:
        return FieldType.KEYWORD;
    }
  }
}
